Namespace - LJCTextDataReaderLib
Parameters
dataObject - The data object.
dataFields - The DbColumns data field definitions object.
Syntax
C# |
public Void LJCSetObjectValues(Object dataObject, DbColumns dataFields = null)
|
Sets the data object property values from the TextDataReader.
(RE)
Remarks
The custom DbColumns data field definitions are used if provided.
Otherwise the internal LJCDataFields property value is used.
This method uses the DbColumn.ColumnName (or DbColumn.RenameAs if provided)
for the source column name and the DbColumn.PropertyName for the object
property name.
Example
C# |
using LJCTextDataReaderLib;
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
TextDataReader textReader = new TextDataReader();
string[] lines = new string[]
{
"FirstName, LastName",
"John, Doe",
"Jane, Doe"
};
textReader.LJCSetLines(lines);
while(textReader.ReadLine())
{
Person person = new Person();
textReader.LJCSetObjectValues(person);
}
|
Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.